package com.angel.arquitectura.dao.impl.user;

import com.angel.arquitectura.dao.user.ActionDAO;
import com.angel.arquitectura.model.action.Action;
import com.angel.arquitectura.model.objectId.ObjectId;
import com.angel.dao.generic.impl.GenericSpringHibernateDAO;

import java.util.List;


public class ActionSpringHibernateDAO extends GenericSpringHibernateDAO<Action, ObjectId> implements ActionDAO {

    public ActionSpringHibernateDAO(){
        super(Action.class, ObjectId.class);
    }

	public List<Action> findAllSorted(){
		/*QueryStatement queryStatement = new HibernateQueryStatement();
        queryStatement.addQuery("from ");
        queryStatement.addQuery(getPersistentClass().getName() + " this ");
        queryStatement.addQuery(" order by descripcion");*/
        return (List<Action>) this.findAll();
	}
	
	public List<Action> findAllByDescription(String description){
        return (List<Action>) this.findAll("description", description);
	}

}
